package Abstract;


	import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.Map;
import java.util.HashMap;
import java.util.Scanner;
import java.text.DecimalFormat;
import java.util.concurrent.ExecutionException;
	
	public abstract class AbstractMC {
	  public static float[][] readFile() throws IOException {
	    final BufferedReader reader = 
	      new BufferedReader(new FileReader("file.txt"));
	    
	    final float[][] values = new float[10][8];
	    
	    String stockInfo = null;
	    for(int j = 0; j<10; j++){

	    	for(int i = 0; i<8; i++){
	      stockInfo = reader.readLine();
	       values[j][i] = Float.parseFloat(stockInfo) ;

	    	
	    }
	    }
	    
	    return values;    
	  }
	   
	  public void timeAndComputeValue() 
	    throws ExecutionException, InterruptedException, IOException { 
		    int choice=0;
		    Scanner sc = new Scanner(System.in);
		    while(!((choice>=1)&&(choice<=10))){
		    System.out.println("\nChoose a set (1-10) :");
		    String str = sc.nextLine();
		    choice = Integer.parseInt(str);
		    }
		    choice = choice-1;
	    final long start = System.nanoTime();
	    
	    final float[][] values = readFile();
	    final double nav = computeMonteCarlo("1",(double)values[choice][0],(double)values[choice][1],(double)values[choice][2],values[choice][3],
	    		(double)values[choice][4],(double)values[choice][5],(int)values[choice][6],(int)values[choice][7]);    
	    
	    final long end = System.nanoTime();

	    System.out.println("Time (seconds) taken " + (end - start)/1.0e9);
	  }

	  public abstract double computeMonteCarlo(String CallPutFlag, double S ,double X,double T ,  
			  double r ,double b,double v,  
			  int nSteps ,int nSimulations) 
	    throws ExecutionException, InterruptedException, IOException;
	}

